//
//  UIImage+CS.h
//
//  Created by 王城山 on 14-5-5.
//  Copyright (c) 2014年 itcast. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>

@interface UIImage (CS)

/**
 *  返回一张自由拉伸的图片
 */
+ (UIImage *)resizedImageWithName:(NSString *)name;

/**
 *  返回一张指定大小的图片
 */
+ (UIImage *)scaleToSize:(UIImage *)img size:(CGSize)size;

/**
 *  返回一张圆形图片
 */
+(UIImage*) circleImage:(UIImage*) image withParam:(CGFloat) inset;

/**
 * 返回视频的截图
 */
+(UIImage *)getImage:(NSURL *)videoURL withImageSize:(CGSize)imageSize;

/**
 * 将一个图片加到另一个图片上
 */
+ (UIImage *)addImage:(UIImage *)addImage aboveOrignImage:(UIImage *)orignImage size:(CGSize)addImageSize;

/**返回一张颜色值生成的图片*/
+ (UIImage *)imageWithColor:(UIColor *)color;

/**
 *  从给定UIView中截图：UIView转UIImage
 */
+(UIImage *)cutFromView:(UIView *)view;


/**
 *  直接截屏
 */
+(UIImage *)cutScreen;

+ (UIImage *) glToUIImage;



/**
 *  从给定UIImage和指定Frame截图：
 */
-(UIImage *)cutWithFrame:(CGRect)frame;

/**
 * 返回一个三角形
 **/
+ (UIImage *)triangleImageWithSize:(CGSize)size tintColor:(UIColor *)tintColor;

+ (UIImage *)image:(UIImage *)image rotation:(UIImageOrientation)orientation;

- (UIImage *)dc_stretchLeftAndRightWithContainerSize:(CGSize)size;

//给图片填充颜色
- (UIImage *) imageWithTintColor:(UIColor *)tintColor;

@end
